<?php
/* @var $this TurmaHasAlunoController */
/* @var $model TurmaHasAluno */

$this->pageTitle=Yii::app()->name . ' - Meus Alunos';

$this->breadcrumbs=array(
	'Meus Alunos',
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#turma-has-aluno-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h3 align="center">Meus Alunos</h3>

</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView',array(
		'id'=>'meus-alunos-grid',
		'pager' => array('cssFile' => Yii::app()->baseUrl . '/css/gridview.css',
				'firstPageLabel'=>'Início',
				'lastPageLabel'=>'Fim',
				'nextPageLabel'=>'Próximo >',
				'header'=>'Página Atual:',
				'prevPageLabel'=>'< Anterior',
				'maxButtonCount'=>'15',),
		'cssFile' => Yii::app()->baseUrl . '/css/gridview.css',
		'htmlOptions'=>array('class'=>'grid-view rounded'),
		'summaryText' => 'Mostrando {start}-{end} de {count} registro(s).',
		'dataProvider'=>$provider,
			'columns'=>array(
				'aluno.pessoa.nome',
				array('name'=>'Turma','value'=>'$data->turmaInt->nome'),
				array('name' => 'Ano da Turma', 'value'=> '$data->turmaInt->ano'),
				array(
						'header' => 'Ações',
						'class' => 'CButtonColumn',
						'htmlOptions' =>array('width'=>'40px'),
						'viewButtonImageUrl' => Yii::app()->baseUrl . '/css/' . 'gr-view.png',
						'updateButtonImageUrl' => Yii::app()->baseUrl . '/css/' . 'gr-update.png',
						'template' => '{view} {update}',
				),
		),
		'emptyText' => 'Usuário não coordena nenhum aluno em turmas.',
)); ?>
